{% extends 'backend_loyout.html' %}
{% block title %}创建文章{% endblock %}
{% block css  %}
    <style>
        .add-article-title{
            width: 100%;
            height: 48px;
            list-style: none;
            line-height: 48px;
        }
        .add-article-title li{
            display: inline-block;
            margin-right: 5px;
        }
        .article-form{
            padding:0px 30px;
        }
        .kind-editor{
            width: 100%;
            min-height: 600px;
        }
    </style>
{% endblock %}

{% block content %}
    <ul class="add-article-title">
        <li style="color: #2aabd2">报障管理</li>
        <li><i class="fa fa-arrow-right" style="margin-right: 5px;"></i>编辑报障单</li>
    </ul>
    <div class="article-form">
        <form action="{% url 'backend:trouble_edit' id %}" method="post" novalidate>
            {% csrf_token %}
            <div class="form-group">
                <label for="{{ form.title.id_for_label }}">标题 <span>{{ form.title.errors.0 }}</span></label>
                {{ form.title }}
            </div>
            <div class="form-group">
                <label>内容 <span>{{ form.detail.errors.0 }}</span></label>
                {{ form.detail }}
            </div>
            <div class="form-group">
                <input type="submit" class="btn btn-primary" value="保 存">
            </div>
        </form>
    </div>
{% endblock %}

{% block js %}
    <script charset="utf-8" src="/static/plugins/kingeditor/kindeditor-all-min.js"></script>
    <script charset="utf-8" src="/static/plugins/kingeditor/lang/zh-CN.js"></script>
    <script>
        KindEditor.ready(function (K) {
            var editor = K.create('#detail', {
                resizeType: 1,
                allowImageUpload: true,
                uploadJson: '{% url "backend:article_images" %}',
                filePostName: 'images',
            });
        });
    </script>
{% endblock %}